import javax.swing.*;
import java.awt.*;

public class Draw extends JFrame
{
        public Draw()
        {
                super("Drawing App");
                setDefaultCloseOperation(EXIT_ON_CLOSE);

                JComponent drawingCanvas = createDrawingCanvas();
                add(drawingCanvas, BorderLayout.CENTER);

                JToolBar toolbar = createToolbar();
                add(toolbar, BorderLayout.NORTH);
        }

        private JComponent createDrawingCanvas()
        {
                JComponent drawingCanvas = new JPanel();
                drawingCanvas.setPreferredSize(new Dimension(400, 300));
                drawingCanvas.setBackground(Color.white);
                drawingCanvas.setBorder(BorderFactory.createEtchedBorder());

                return drawingCanvas;
        }

        private JToolBar createToolbar()
        {
                JToolBar toolbar = new JToolBar();
                JButton ellipseButton = new JButton("Ellipse");
                toolbar.add(ellipseButton);
                JButton squareButton = new JButton("Square");
                toolbar.add(squareButton);
                JButton RectButton = new JButton("Rect");
                toolbar.add(RectButton);

                return toolbar;
        }

        public static void main(String[] args)
        {
                Draw draw = new Draw();
                draw.pack();
                draw.setVisible(true);
        }
}
